<?php

use admin\widgets\AdminToolbar;
use admin\components\BaseGridView;

/* @var $dataProvider */
?>

<?= AdminToolbar::widget(); ?>

<?= BaseGridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => NULL,
    'columns' => [
        ['attribute' => 'id', 'headerOptions' => ['width' => '5%']],
        'gname',
        [
            'class' => 'admin\components\BaseActionColumn',
            'template' => '{view} {save}',
            'saveOptions' => ['class' => 'dialog', 'title' => '权限', 'data-width' => 500],
            'buttons' => [
                'view' => function ($url, $model, $key) {
                    $options = ['title' => '成员列表', 'data-toggle' => 'tooltip'];
                    $url = ['user/', 'gid' => $model->id];
                    return \yii\helpers\Html::a('<span class="glyphicon glyphicon-eye-open"></span>', $url, $options);
                }
            ]
        ],
    ],
]); ?>
